<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page import="java.util.ArrayList" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>coreforeach</title>
</head>
<body>
<%
    ArrayList<String> arrayList=new ArrayList<>();
    arrayList.add(0,"lp");
    arrayList.add(1,"rx");
    arrayList.add(2,"fy");
    arrayList.add(3,"cl");
    arrayList.add(4,"ct");
    arrayList.add(5,"xd");
    application.setAttribute("list",arrayList);
%>
<%--
var,每一次遍历出来的变量
items,要遍历的对象
begin,哪里开始
end,哪里结束
step,步长
--%>
<c:forEach var="people" items="${list}" >
    <c:out value="${people}"/><br>
</c:forEach>
<hr>
<c:forEach var="people" items="${list}" begin="1" end="3" step="2">
    <c:out value="${people}"/><br>
</c:forEach>
</body>
</html>
